package com.linkhub.oms.data.sync.api.wms.domain.response;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: BatchCreateStockOutListResponse
 * @Author: Jaycle
 * @Date: 2024/06/15 22:50
 * @Version: 1.0.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class StockOutBatchCreateResponse extends WmsBaseResponse implements Serializable {
    /**
     * Response对象
     */
    @JSONField(name = "response")
    private Response response;

    /**
     * 获取响应标志
     */
    @Override
    protected String getFlag() {
        return response != null ? response.getFlag() : null;
    }

    /**
     * Response内部类
     */
    @Data
    @NoArgsConstructor
    public static class Response {
        /**
         * 状态标志，success或failure
         */
        @JSONField(name = "flag")
        private String flag;

        /**
         * 响应代码
         */
        @JSONField(name = "code")
        private int code;

        /**
         * 响应消息
         */
        @JSONField(name = "message")
        private String message;

        /**
         * 订单信息列表
         */
        @JSONField(name = "orders")
        private Orders orders;
    }

    /**
     * 订单列表内部类
     */
    @Data
    @NoArgsConstructor
    public static class Orders {
        /**
         * 订单列表
         */
        @JSONField(name = "order")
        private List<Order> order;
    }

    /**
     * 订单信息内部类
     */
    @Data
    @NoArgsConstructor
    public static class Order {
        /**
         * 出库单号
         */
        @JSONField(name = "deliveryOrderCode")
        private String deliveryOrderCode;

        /**
         * 消息
         */
        @JSONField(name = "message")
        private String message;
    }
}
